MutableSubscriptionSet

interface MutableSubscriptionSet : BaseSubscriptionSet

A mutable subscription set makes it possible to add, remove or modify a SubscriptionSet. It becomes available when calling SubscriptionSet.update.

See also

io.realm.kotlin.mongodb.sync.SubscriptionSet

for more information about subscription sets and Flexible Sync.

Functions

add
Link copied to clipboard
abstract fun <T : RealmObject> add(query: RealmQuery<T>, name: String? = null, updateExisting: Boolean = false): Subscription
Adds a new subscription to the subscription set.
findByName
Link copied to clipboard
abstract fun findByName(name: String): Subscription?
Find the subscription with a given name.
findByQuery
Link copied to clipboard
abstract fun <T : RealmObject> findByQuery(query: RealmQuery<T>): Subscription?
Find the first subscription that contains the given query.
iterator
Link copied to clipboard
abstract operator fun iterator(): Iterator<Subscription>
remove
Link copied to clipboard
abstract fun remove(subscription: Subscription): Boolean
Remove a subscription.
abstract fun remove(name: String): Boolean
Remove a named subscription.
removeAll
Link copied to clipboard
abstract fun removeAll(): Boolean
Remove all subscriptions in this subscription set.
abstract fun removeAll(objectType: String): Boolean
Remove all subscriptions with queries on a given Subscription.objectType.
abstract fun <T : RealmObject> removeAll(type: KClass<T>): Boolean
Remove all subscriptions with queries on a given model class.
subscribe
Link copied to clipboard
open fun RealmQuery<out RealmObject>.subscribe(): Subscription
Creates an anonymous Subscription in the current MutableSubscriptionSet directly from a RealmQuery.
open fun RealmQuery<out RealmObject>.subscribe(name: String, updateExisting: Boolean = false): Subscription
Creates a named Subscription in the current MutableSubscriptionSet directly from a RealmQuery.

Properties

errorMessage
Link copied to clipboard
abstract val errorMessage: String?
If state returns SubscriptionSetState.ERROR, this method will return the reason.
size
Link copied to clipboard
abstract val size: Int
The number of subscriptions currently in this subscription set.
state
Link copied to clipboard
abstract val state: SubscriptionSetState
The current state of the SubscriptionSet.